-----------------------------------------------------------------------------------------------------------------------------------------------
--删除CMake专有命令
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
--全局变量存储全局信息
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
-- 开始 
-----------------------------------------------------------------------------------------------------------------------------------------------
-- use and save result to globalTableTokenTable
local localStrLuaName="PreParseCMake.lua"
if globalBoolLuaDebugOutputFlag then
	print(localStrLuaName.." start...")
end
-----------------------------------------------------------------------------------------------------------------------------------------
--common tools 
-----------------------------------------------------------------------------------------------------------------------------------------
require(globalStrModuleUtilities)
-----------------------------------------------------------------------------------------------------------------------------------------
--扫描并跳过CMake专用命令
-----------------------------------------------------------------------------------------------------------------------------------------
function skipCMakePreParse(tokenCounter)
	local distTempTable={}
	local ret = parseCommonSamilar(tokenCounter,distTempTable,globalTableTokenTable)
	return ret
end
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
--扫描并跳过CMake专用命令
-----------------------------------------------------------------------------------------------------------------------------------------
local localTokenTable ={}
local tokenCounter = 1
while 1 do
	local token = globalTableTokenTable[tokenCounter]
	if nil == token then
		break
	end
	local tokenCmp = string.lower(token)
	if "cmake_minimum_required" == tokenCmp then
		tokenCounter = skipCMakePreParse(tokenCounter)
	elseif "cmake_policy" == tokenCmp then
		tokenCounter = skipCMakePreParse(tokenCounter)
	else
		tokenCounter = tokenCounter + 1
		table.insert(localTokenTable,token)
	end
end
-----------------------------------------------------------------------------------------------------------------------------------------
--代入全局变量
-----------------------------------------------------------------------------------------------------------------------------------------
globalTableTokenTable = localTokenTable
-----------------------------------------------------------------------------------------------------------------------------------------
--打印Token
-----------------------------------------------------------------------------------------------------------------------------------------
if globalBoolLuaDebugOutputFlag then
	for i,v in pairs (globalTableTokenTable) do 
		print(i,v)
	end
end
if globalBoolLuaDebugOutputFlag then
	print(localStrLuaName.." ...end")
end

